<?php

function lib_brandindex(&$ctag,&$refObj){
	 global $dsql;
	 //属性处理
 	$attlist="row|100";
    FillAttsDefault($ctag->CAttribute->Items,$attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    
    $innertext = $ctag->GetInnerText();
    $row = !empty($row) ? $row : 100;
    
    $query = "SELECT id,typename,picname FROM `#@__arctype` WHERE reid=52 limit ".$row;
    $dsql->Execute('me', $query);
    $html = '';
    
    while ($row = $dsql->GetArray('me')){
    	if(empty($row['picname'])){
    		$row['picname'] = '/images/brand.jpg';
    	}
    	$html .= '<a href="/brand-'.$row['id'].'.html" target="_blank"><img src="'.$row['picname'].'" alt="'.$row['typename'].'" /></a>';
    }
    return $html;
}
?>